﻿using System;
using System.Linq;

namespace MusicPlayer
{
    class OrderDefault : IOrder
    {
        public int GetNextToPlay(int currentSong, int totalSongs)
        {
            int nextSong;

            if (currentSong < totalSongs - 1)
            {
                nextSong = currentSong + 1;
            }
            else
            {
                nextSong = 0;
            }

            return nextSong;
        }

        public int GetPrevToPlay(int currentSong, int totalSongs)
        {
            int prevSong;

            if (currentSong > 0)
            {
                prevSong = currentSong - 1;
            }
            else
            {
                prevSong = totalSongs - 1;
            }

            return prevSong;
        }
    }
}
